package com.resume.aipeople.config;

import com.resume.aipeople.service.ai.model.GLM4ModelStrategy;
import com.resume.aipeople.service.ai.model.GLM45ModelStrategy;
import com.resume.aipeople.service.ai.model.GeminiModelStrategy;
import com.resume.aipeople.service.ai.model.LLMModelManager;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

/**
 * 模型配置类
 * 负责注册所有可用的LLM模型策略
 */
@Configuration
@RequiredArgsConstructor
@Slf4j
public class ModelConfig {
    
    private final LLMModelManager modelManager;
    private final GLM4ModelStrategy glm4Strategy;
    private final GLM45ModelStrategy glm45Strategy;
    private final GeminiModelStrategy geminiStrategy;
    
    @PostConstruct
    public void registerModelStrategies() {
        log.info("开始注册LLM模型策略...");
        
        // 先注册GLM-4模型策略（作为默认模型）
        modelManager.registerModelStrategy(glm4Strategy);
        
        // 注册GLM-4.5模型策略
        modelManager.registerModelStrategy(glm45Strategy);
        
        // 注册Gemini模型策略
        modelManager.registerModelStrategy(geminiStrategy);
        
        log.info("LLM模型策略注册完成，当前默认模型: {}", modelManager.getCurrentModelDisplayName());
    }
}
